package cn.example.configure;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 定时任务配置类
 * Created by WuYB on 2017/3/21.
 */
@Component
@EnableScheduling
public class SchedulingConfig {

    private final Logger log = LoggerFactory.getLogger(this.getClass());

    @Scheduled(cron = "0 0 11 * * ?")
    private void process() {
        log.info("time task test!**每天上午11触发");
    }

    @Scheduled(cron = "${jobs.schedule}")
    private void process2() {
        log.info("time task test!**每天上午12触发");
    }
}

